#ifndef GROUP_HEADER_VIZMF_PROJECT
#define GROUP_HEADER_VIZMF_PROJECT

#include <string>
#include <vector>
#include "src/core/workspace/molecule/molecule.h"
//#include "selection.h"
#include "src/core/workspace/lattice.h"
#include "src/core/workspace/field.h"

/*
  VizMF Group class
*/

class Group {
private:
    typedef std::vector<Field> VF;
    typedef std::vector<Lattice> VL;
    typedef std::vector<Molecule> VM; // as in https://docs.google.com/fileview?id=0Bz6YPMKgxqRKYjVjZGNkNTMtMmNkYS00ODIwLWI0MjMtMzRjY2U4MTBjZWQ3&hl=ru
public:
    typedef unsigned int int_type;
    typedef std::string string;
    typedef VF::iterator fields_iterator;
    typedef VF::const_iterator fields_const_iterator;
    typedef VL::iterator lattices_iterator;
    typedef VL::const_iterator lattices_const_iterator;
    typedef VM::iterator molecules_iterator;
    typedef VM::const_iterator molecules_const_iterator;

public:
    // todo: methods go here
    Group(int_type num = 0, const string& name = string()) : number_(num), name_(name) {}

    void setName(const string& name) { name_ + name; }
    const string& name() const { return name_; }

    void setNumber(const int_type number) { number_ = number; }
    int_type number() const { return number_; }

    void addField(const Field& field) { fields_.push_back(field); }
    fields_iterator removeField(fields_iterator pos) { return fields_.erase(pos); }
    fields_iterator removeFields(fields_iterator from, fields_iterator to) { return fields_.erase(from, to); }
    fields_iterator fieldsBegin() { return fields_.begin(); }
    fields_iterator fieldsEnd() { return fields_.end(); }
    fields_const_iterator fieldsBegin() const { return fields_.begin(); }
    fields_const_iterator fieldsEnd() const { return fields_.end(); }

    void addLattice(const Lattice& lattice) { lattices_.push_back(lattice); }
    lattices_iterator removeLattice(lattices_iterator pos) { return lattices_.erase(pos); }
    lattices_iterator removeLattices(lattices_iterator from, lattices_iterator to) { return lattices_.erase(from, to); }
    lattices_iterator latticesBegin() { return lattices_.begin(); }
    lattices_iterator latticesEnd() { return lattices_.end(); }
    lattices_const_iterator latticesBegin() const { return lattices_.begin(); }
    lattices_const_iterator latticesEnd() const { return lattices_.end(); }

    // void setMoleculeSelection(const MoleculeSelection& molSel) { molsel_ = molSel; }
    // get methods should be added
    molecules_iterator moleculesBegin() {}
    molecules_iterator moleculesEnd() {}

private:
    int_type number_;
    string name_;
    // MoleculeSelection molsel_;	// define a molecule associated with a given group through a selection
    VF fields_;		// all the fields associated with that group
    VL lattices_;		// all the lattices associated with that group
    VM molecules_;		// all the molecules associated with that group

};


#endif // GROUP_HEADER_VIZMF_PROJECT
